<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenShoe: compiler.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenShoe
   &#160;<span id="projectnumber">0.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">compiler.h</div>  </div>
</div>
<div class="contents">
<a href="_framework__and__interfaces_2src_2asf_2avr32_2utils_2compiler_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*This file is prepared for Doxygen automatic documentation generation.*/</span>
<a name="l00017"></a>00017 <span class="comment">/* Copyright (c) 2009 Atmel Corporation. All rights reserved.</span>
<a name="l00018"></a>00018 <span class="comment"> *</span>
<a name="l00019"></a>00019 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
<a name="l00020"></a>00020 <span class="comment"> * modification, are permitted provided that the following conditions are met:</span>
<a name="l00021"></a>00021 <span class="comment"> *</span>
<a name="l00022"></a>00022 <span class="comment"> * 1. Redistributions of source code must retain the above copyright notice, this</span>
<a name="l00023"></a>00023 <span class="comment"> * list of conditions and the following disclaimer.</span>
<a name="l00024"></a>00024 <span class="comment"> *</span>
<a name="l00025"></a>00025 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright notice,</span>
<a name="l00026"></a>00026 <span class="comment"> * this list of conditions and the following disclaimer in the documentation</span>
<a name="l00027"></a>00027 <span class="comment"> * and/or other materials provided with the distribution.</span>
<a name="l00028"></a>00028 <span class="comment"> *</span>
<a name="l00029"></a>00029 <span class="comment"> * 3. The name of Atmel may not be used to endorse or promote products derived</span>
<a name="l00030"></a>00030 <span class="comment"> * from this software without specific prior written permission.</span>
<a name="l00031"></a>00031 <span class="comment"> *</span>
<a name="l00032"></a>00032 <span class="comment"> * 4. This software may only be redistributed and used in connection with an Atmel</span>
<a name="l00033"></a>00033 <span class="comment"> * AVR product.</span>
<a name="l00034"></a>00034 <span class="comment"> *</span>
<a name="l00035"></a>00035 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY ATMEL &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED</span>
<a name="l00036"></a>00036 <span class="comment"> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF</span>
<a name="l00037"></a>00037 <span class="comment"> * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE</span>
<a name="l00038"></a>00038 <span class="comment"> * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR</span>
<a name="l00039"></a>00039 <span class="comment"> * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES</span>
<a name="l00040"></a>00040 <span class="comment"> * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</span>
<a name="l00041"></a>00041 <span class="comment"> * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND</span>
<a name="l00042"></a>00042 <span class="comment"> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span>
<a name="l00043"></a>00043 <span class="comment"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span>
<a name="l00044"></a>00044 <span class="comment"> * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE</span>
<a name="l00045"></a>00045 <span class="comment"> *</span>
<a name="l00046"></a>00046 <span class="comment"> */</span>
<a name="l00047"></a>00047 
<a name="l00048"></a>00048 <span class="preprocessor">#ifndef _COMPILER_AVR32_H_</span>
<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor">#define _COMPILER_AVR32_H_</span>
<a name="l00050"></a>00050 <span class="preprocessor"></span>
<a name="l00051"></a>00051 <span class="preprocessor">#if (defined __ICCAVR32__)</span>
<a name="l00052"></a>00052 <span class="preprocessor"></span><span class="preprocessor">#  include &lt;intrinsics.h&gt;</span>
<a name="l00053"></a>00053 <span class="preprocessor">#endif</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#include &quot;preprocessor.h&quot;</span>
<a name="l00055"></a>00055 
<a name="l00056"></a>00056 <span class="preprocessor">#include &quot;parts.h&quot;</span>
<a name="l00057"></a>00057 
<a name="l00058"></a>00058 
<a name="l00059"></a>00059 <span class="comment">//_____ D E C L A R A T I O N S ____________________________________________</span>
<a name="l00060"></a>00060 
<a name="l00061"></a>00061 <span class="preprocessor">#ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.</span>
<a name="l00062"></a>00062 <span class="preprocessor"></span>
<a name="l00063"></a>00063 <span class="preprocessor">#include &lt;stddef.h&gt;</span>
<a name="l00064"></a>00064 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00065"></a>00065 <span class="preprocessor">#include &lt;stdbool.h&gt;</span>
<a name="l00066"></a>00066 <span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00067"></a>00067 
<a name="l00068"></a>00068 
<a name="l00069"></a>00069 <span class="preprocessor">#if (defined __ICCAVR32__)</span>
<a name="l00070"></a>00070 <span class="preprocessor"></span>
<a name="l00075"></a>00075 
<a name="l00076"></a>00076 <span class="preprocessor">#define __asm__             asm</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span><span class="preprocessor">#define __inline__          inline</span>
<a name="l00078"></a>00078 <span class="preprocessor"></span><span class="preprocessor">#define __volatile__</span>
<a name="l00079"></a>00079 <span class="preprocessor"></span>
<a name="l00080"></a>00080 
<a name="l00081"></a>00081 <span class="preprocessor">#endif</span>
<a name="l00082"></a>00082 <span class="preprocessor"></span>
<a name="l00087"></a>00087 <span class="preprocessor">#if defined(__GNUC__)</span>
<a name="l00088"></a>00088 <span class="preprocessor"></span><span class="preprocessor">#  define barrier()        asm volatile(&quot;&quot; ::: &quot;memory&quot;)</span>
<a name="l00089"></a>00089 <span class="preprocessor"></span><span class="preprocessor">#elif defined(__ICCAVR32__)</span>
<a name="l00090"></a>00090 <span class="preprocessor"></span><span class="preprocessor">#  define barrier()        __asm__ __volatile__ (&quot;&quot;)</span>
<a name="l00091"></a>00091 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00092"></a>00092 <span class="preprocessor"></span>
<a name="l00099"></a>00099 <span class="preprocessor">#define COMPILER_PRAGMA(arg)            _Pragma(#arg)</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span>
<a name="l00106"></a>00106 <span class="preprocessor">#define COMPILER_PACK_SET(alignment)   COMPILER_PRAGMA(pack(alignment))</span>
<a name="l00107"></a>00107 <span class="preprocessor"></span>
<a name="l00113"></a>00113 <span class="preprocessor">#define COMPILER_PACK_RESET()          COMPILER_PRAGMA(pack())</span>
<a name="l00114"></a>00114 <span class="preprocessor"></span>
<a name="l00115"></a>00115 
<a name="l00119"></a>00119 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l00120"></a>00120 <span class="preprocessor"></span><span class="preprocessor">#define COMPILER_ALIGNED(a)    __attribute__((__aligned__(a)))</span>
<a name="l00121"></a>00121 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l00122"></a>00122 <span class="preprocessor"></span><span class="preprocessor">#define COMPILER_ALIGNED(a)    COMPILER_PRAGMA(data_alignment = a)</span>
<a name="l00123"></a>00123 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00124"></a>00124 <span class="preprocessor"></span>
<a name="l00128"></a>00128 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l00129"></a>00129 <span class="preprocessor"></span><span class="preprocessor">#define COMPILER_WORD_ALIGNED    __attribute__((__aligned__(4)))</span>
<a name="l00130"></a>00130 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l00131"></a>00131 <span class="preprocessor"></span><span class="preprocessor">#define COMPILER_WORD_ALIGNED    COMPILER_PRAGMA(data_alignment = 4)</span>
<a name="l00132"></a>00132 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00133"></a>00133 <span class="preprocessor"></span>
<a name="l00138"></a>00138 <span class="preprocessor">#if defined(__GNUC__) || defined(__DOXYGEN__)</span>
<a name="l00139"></a>00139 <span class="preprocessor"></span>
<a name="l00146"></a>00146 <span class="preprocessor">#  define sysreg_read(reg)               __builtin_mfsr(reg)</span>
<a name="l00147"></a>00147 <span class="preprocessor"></span>
<a name="l00164"></a>00164 <span class="preprocessor">#if ((defined __GNUC__) &amp;&amp; (__GNUC__ &gt; 3 || (__GNUC__ == 3 &amp;&amp; __GNUC_MINOR__ &gt;=1)))</span>
<a name="l00165"></a>00165 <span class="preprocessor"></span><span class="preprocessor">#define __DEPRECATED__  __attribute__((__deprecated__))</span>
<a name="l00166"></a>00166 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00167"></a>00167 <span class="preprocessor"></span><span class="preprocessor">#define __DEPRECATED__</span>
<a name="l00168"></a>00168 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00169"></a>00169 <span class="preprocessor"></span>
<a name="l00170"></a>00170 
<a name="l00177"></a>00177 <span class="preprocessor">#  define sysreg_write(reg, val)         __builtin_mtsr(reg, val)</span>
<a name="l00178"></a>00178 <span class="preprocessor"></span>
<a name="l00179"></a>00179 <span class="preprocessor">#elif defined(__ICCAVR32__)</span>
<a name="l00180"></a>00180 <span class="preprocessor"></span><span class="preprocessor">#  define sysreg_read(reg)               __get_system_register(reg)</span>
<a name="l00181"></a>00181 <span class="preprocessor"></span><span class="preprocessor">#  define sysreg_write(reg, val)         __set_system_register(reg, val)</span>
<a name="l00182"></a>00182 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00183"></a>00183 <span class="preprocessor"></span>
<a name="l00184"></a>00184 <span class="comment">// Deprecated definitions</span>
<a name="l00185"></a>00185 <span class="preprocessor">#define Get_system_register(reg)         sysreg_read(reg)</span>
<a name="l00186"></a>00186 <span class="preprocessor"></span><span class="preprocessor">#define Set_system_register(reg, val)    sysreg_write(reg, val)</span>
<a name="l00187"></a>00187 <span class="preprocessor"></span>
<a name="l00188"></a>00188 
<a name="l00189"></a>00189 <span class="preprocessor">#include &quot;interrupt.h&quot;</span>
<a name="l00190"></a>00190 
<a name="l00193"></a>00193 
<a name="l00194"></a>00194 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>           Bool; 
<a name="l00195"></a>00195 <span class="preprocessor">#ifndef __cplusplus</span>
<a name="l00196"></a>00196 <span class="preprocessor"></span><span class="preprocessor">#if !defined(__bool_true_false_are_defined)</span>
<a name="l00197"></a>00197 <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>           bool; 
<a name="l00198"></a>00198 <span class="preprocessor">#endif</span>
<a name="l00199"></a>00199 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00200"></a>00200 <span class="preprocessor"></span><span class="keyword">typedef</span> int8_t                  S8 ;  
<a name="l00201"></a>00201 <span class="keyword">typedef</span> uint8_t                 U8 ;  
<a name="l00202"></a>00202 <span class="keyword">typedef</span> int16_t                 S16;  
<a name="l00203"></a>00203 <span class="keyword">typedef</span> uint16_t                U16;  
<a name="l00204"></a>00204 <span class="keyword">typedef</span> uint16_t                le16_t;
<a name="l00205"></a>00205 <span class="keyword">typedef</span> uint16_t                be16_t;
<a name="l00206"></a>00206 <span class="keyword">typedef</span> int32_t                 S32;  
<a name="l00207"></a>00207 <span class="keyword">typedef</span> uint32_t                U32;  
<a name="l00208"></a>00208 <span class="keyword">typedef</span> uint32_t                le32_t;
<a name="l00209"></a>00209 <span class="keyword">typedef</span> uint32_t                be32_t;
<a name="l00210"></a>00210 <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span> <span class="keywordtype">int</span>    S64;  
<a name="l00211"></a>00211 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span> <span class="keywordtype">int</span>  U64;  
<a name="l00212"></a>00212 <span class="keyword">typedef</span> <span class="keywordtype">float</span>                   F32;  
<a name="l00213"></a>00213 <span class="keyword">typedef</span> <span class="keywordtype">double</span>                  F64;  
<a name="l00214"></a>00214 <span class="keyword">typedef</span> uint32_t                iram_size_t;
<a name="l00216"></a>00216 
<a name="l00217"></a>00217 
<a name="l00220"></a>00220 
<a name="l00221"></a>00221 <span class="keyword">typedef</span> <span class="keywordtype">bool</span>                Status_bool_t;  
<a name="l00222"></a>00222 <span class="keyword">typedef</span> U8                  Status_t;       
<a name="l00223"></a>00223 
<a name="l00224"></a>00224 
<a name="l00225"></a>00225 
<a name="l00228"></a>00228 
<a name="l00229"></a>00229 
<a name="l00231"></a>00231 <span class="keyword">typedef</span> <span class="keyword">union</span>
<a name="l00232"></a>00232 {
<a name="l00233"></a>00233   S16 s16   ;
<a name="l00234"></a>00234   U16 u16   ;
<a name="l00235"></a>00235   S8  s8 [2];
<a name="l00236"></a>00236   U8  <a class="code" href="nlao__io_8h.html#a72301533cb67d5bcac097074175ec5a7">u8</a> [2];
<a name="l00237"></a>00237 } Union16;
<a name="l00238"></a>00238 
<a name="l00240"></a>00240 <span class="keyword">typedef</span> <span class="keyword">union</span>
<a name="l00241"></a>00241 {
<a name="l00242"></a>00242   S32 s32   ;
<a name="l00243"></a>00243   U32 <a class="code" href="nlao__io_8h.html#a10e94b422ef0c20dcdec20d31a1f5049">u32</a>   ;
<a name="l00244"></a>00244   S16 s16[2];
<a name="l00245"></a>00245   U16 u16[2];
<a name="l00246"></a>00246   S8  s8 [4];
<a name="l00247"></a>00247   U8  <a class="code" href="nlao__io_8h.html#a72301533cb67d5bcac097074175ec5a7">u8</a> [4];
<a name="l00248"></a>00248 } Union32;
<a name="l00249"></a>00249 
<a name="l00251"></a>00251 <span class="keyword">typedef</span> <span class="keyword">union</span>
<a name="l00252"></a>00252 {
<a name="l00253"></a>00253   S64 s64   ;
<a name="l00254"></a>00254   U64 u64   ;
<a name="l00255"></a>00255   S32 s32[2];
<a name="l00256"></a>00256   U32 <a class="code" href="nlao__io_8h.html#a10e94b422ef0c20dcdec20d31a1f5049">u32</a>[2];
<a name="l00257"></a>00257   S16 s16[4];
<a name="l00258"></a>00258   U16 u16[4];
<a name="l00259"></a>00259   S8  s8 [8];
<a name="l00260"></a>00260   U8  <a class="code" href="nlao__io_8h.html#a72301533cb67d5bcac097074175ec5a7">u8</a> [8];
<a name="l00261"></a>00261 } Union64;
<a name="l00262"></a>00262 
<a name="l00264"></a>00264 <span class="keyword">typedef</span> <span class="keyword">union</span>
<a name="l00265"></a>00265 {
<a name="l00266"></a>00266   S64 *s64ptr;
<a name="l00267"></a>00267   U64 *u64ptr;
<a name="l00268"></a>00268   S32 *s32ptr;
<a name="l00269"></a>00269   U32 *u32ptr;
<a name="l00270"></a>00270   S16 *s16ptr;
<a name="l00271"></a>00271   U16 *u16ptr;
<a name="l00272"></a>00272   S8  *s8ptr ;
<a name="l00273"></a>00273   U8  *u8ptr ;
<a name="l00274"></a>00274 } UnionPtr;
<a name="l00275"></a>00275 
<a name="l00277"></a>00277 <span class="keyword">typedef</span> <span class="keyword">union</span>
<a name="l00278"></a>00278 {
<a name="l00279"></a>00279   <span class="keyword">volatile</span> S64 *s64ptr;
<a name="l00280"></a>00280   <span class="keyword">volatile</span> U64 *u64ptr;
<a name="l00281"></a>00281   <span class="keyword">volatile</span> S32 *s32ptr;
<a name="l00282"></a>00282   <span class="keyword">volatile</span> U32 *u32ptr;
<a name="l00283"></a>00283   <span class="keyword">volatile</span> S16 *s16ptr;
<a name="l00284"></a>00284   <span class="keyword">volatile</span> U16 *u16ptr;
<a name="l00285"></a>00285   <span class="keyword">volatile</span> S8  *s8ptr ;
<a name="l00286"></a>00286   <span class="keyword">volatile</span> U8  *u8ptr ;
<a name="l00287"></a>00287 } UnionVPtr;
<a name="l00288"></a>00288 
<a name="l00290"></a>00290 <span class="keyword">typedef</span> <span class="keyword">union</span>
<a name="l00291"></a>00291 {
<a name="l00292"></a>00292   <span class="keyword">const</span> S64 *s64ptr;
<a name="l00293"></a>00293   <span class="keyword">const</span> U64 *u64ptr;
<a name="l00294"></a>00294   <span class="keyword">const</span> S32 *s32ptr;
<a name="l00295"></a>00295   <span class="keyword">const</span> U32 *u32ptr;
<a name="l00296"></a>00296   <span class="keyword">const</span> S16 *s16ptr;
<a name="l00297"></a>00297   <span class="keyword">const</span> U16 *u16ptr;
<a name="l00298"></a>00298   <span class="keyword">const</span> S8  *s8ptr ;
<a name="l00299"></a>00299   <span class="keyword">const</span> U8  *u8ptr ;
<a name="l00300"></a>00300 } UnionCPtr;
<a name="l00301"></a>00301 
<a name="l00303"></a>00303 <span class="keyword">typedef</span> <span class="keyword">union</span>
<a name="l00304"></a>00304 {
<a name="l00305"></a>00305   <span class="keyword">const</span> <span class="keyword">volatile</span> S64 *s64ptr;
<a name="l00306"></a>00306   <span class="keyword">const</span> <span class="keyword">volatile</span> U64 *u64ptr;
<a name="l00307"></a>00307   <span class="keyword">const</span> <span class="keyword">volatile</span> S32 *s32ptr;
<a name="l00308"></a>00308   <span class="keyword">const</span> <span class="keyword">volatile</span> U32 *u32ptr;
<a name="l00309"></a>00309   <span class="keyword">const</span> <span class="keyword">volatile</span> S16 *s16ptr;
<a name="l00310"></a>00310   <span class="keyword">const</span> <span class="keyword">volatile</span> U16 *u16ptr;
<a name="l00311"></a>00311   <span class="keyword">const</span> <span class="keyword">volatile</span> S8  *s8ptr ;
<a name="l00312"></a>00312   <span class="keyword">const</span> <span class="keyword">volatile</span> U8  *u8ptr ;
<a name="l00313"></a>00313 } UnionCVPtr;
<a name="l00314"></a>00314 
<a name="l00316"></a>00316 <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00317"></a>00317 {
<a name="l00318"></a>00318   S64 *s64ptr;
<a name="l00319"></a>00319   U64 *u64ptr;
<a name="l00320"></a>00320   S32 *s32ptr;
<a name="l00321"></a>00321   U32 *u32ptr;
<a name="l00322"></a>00322   S16 *s16ptr;
<a name="l00323"></a>00323   U16 *u16ptr;
<a name="l00324"></a>00324   S8  *s8ptr ;
<a name="l00325"></a>00325   U8  *u8ptr ;
<a name="l00326"></a>00326 } StructPtr;
<a name="l00327"></a>00327 
<a name="l00329"></a>00329 <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00330"></a>00330 {
<a name="l00331"></a>00331   <span class="keyword">volatile</span> S64 *s64ptr;
<a name="l00332"></a>00332   <span class="keyword">volatile</span> U64 *u64ptr;
<a name="l00333"></a>00333   <span class="keyword">volatile</span> S32 *s32ptr;
<a name="l00334"></a>00334   <span class="keyword">volatile</span> U32 *u32ptr;
<a name="l00335"></a>00335   <span class="keyword">volatile</span> S16 *s16ptr;
<a name="l00336"></a>00336   <span class="keyword">volatile</span> U16 *u16ptr;
<a name="l00337"></a>00337   <span class="keyword">volatile</span> S8  *s8ptr ;
<a name="l00338"></a>00338   <span class="keyword">volatile</span> U8  *u8ptr ;
<a name="l00339"></a>00339 } StructVPtr;
<a name="l00340"></a>00340 
<a name="l00342"></a>00342 <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00343"></a>00343 {
<a name="l00344"></a>00344   <span class="keyword">const</span> S64 *s64ptr;
<a name="l00345"></a>00345   <span class="keyword">const</span> U64 *u64ptr;
<a name="l00346"></a>00346   <span class="keyword">const</span> S32 *s32ptr;
<a name="l00347"></a>00347   <span class="keyword">const</span> U32 *u32ptr;
<a name="l00348"></a>00348   <span class="keyword">const</span> S16 *s16ptr;
<a name="l00349"></a>00349   <span class="keyword">const</span> U16 *u16ptr;
<a name="l00350"></a>00350   <span class="keyword">const</span> S8  *s8ptr ;
<a name="l00351"></a>00351   <span class="keyword">const</span> U8  *u8ptr ;
<a name="l00352"></a>00352 } StructCPtr;
<a name="l00353"></a>00353 
<a name="l00355"></a>00355 <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l00356"></a>00356 {
<a name="l00357"></a>00357   <span class="keyword">const</span> <span class="keyword">volatile</span> S64 *s64ptr;
<a name="l00358"></a>00358   <span class="keyword">const</span> <span class="keyword">volatile</span> U64 *u64ptr;
<a name="l00359"></a>00359   <span class="keyword">const</span> <span class="keyword">volatile</span> S32 *s32ptr;
<a name="l00360"></a>00360   <span class="keyword">const</span> <span class="keyword">volatile</span> U32 *u32ptr;
<a name="l00361"></a>00361   <span class="keyword">const</span> <span class="keyword">volatile</span> S16 *s16ptr;
<a name="l00362"></a>00362   <span class="keyword">const</span> <span class="keyword">volatile</span> U16 *u16ptr;
<a name="l00363"></a>00363   <span class="keyword">const</span> <span class="keyword">volatile</span> S8  *s8ptr ;
<a name="l00364"></a>00364   <span class="keyword">const</span> <span class="keyword">volatile</span> U8  *u8ptr ;
<a name="l00365"></a>00365 } StructCVPtr;
<a name="l00366"></a>00366 
<a name="l00368"></a>00368 
<a name="l00369"></a>00369 <span class="preprocessor">#endif  // __AVR32_ABI_COMPILER__</span>
<a name="l00370"></a>00370 <span class="preprocessor"></span>
<a name="l00371"></a>00371 
<a name="l00372"></a>00372 <span class="comment">//_____ M A C R O S ________________________________________________________</span>
<a name="l00373"></a>00373 
<a name="l00376"></a>00376 
<a name="l00377"></a><a class="code" href="_framework__and__interfaces_2src_2asf_2avr32_2utils_2compiler_8h.html#a99496f7308834e8b220f7894efa0b6ab">00377</a> <span class="preprocessor">#define DISABLE   0</span>
<a name="l00378"></a><a class="code" href="_framework__and__interfaces_2src_2asf_2avr32_2utils_2compiler_8h.html#a514ad415fb6125ba296793df7d1a468a">00378</a> <span class="preprocessor"></span><span class="preprocessor">#define ENABLE    1</span>
<a name="l00379"></a>00379 <span class="preprocessor"></span><span class="preprocessor">#ifndef __cplusplus</span>
<a name="l00380"></a>00380 <span class="preprocessor"></span><span class="preprocessor">#if !defined(__bool_true_false_are_defined)</span>
<a name="l00381"></a><a class="code" href="_framework__and__interfaces_2src_2asf_2avr32_2utils_2compiler_8h.html#a65e9886d74aaee76545e83dd09011727">00381</a> <span class="preprocessor"></span><span class="preprocessor">#define false     0</span>
<a name="l00382"></a><a class="code" href="_framework__and__interfaces_2src_2asf_2avr32_2utils_2compiler_8h.html#a41f9c5fb8b08eb5dc3edce4dcb37fee7">00382</a> <span class="preprocessor"></span><span class="preprocessor">#define true      1</span>
<a name="l00383"></a>00383 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00384"></a>00384 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00385"></a><a class="code" href="_framework__and__interfaces_2src_2asf_2avr32_2utils_2compiler_8h.html#aba5c54fadff8d880b1945dde87496e31">00385</a> <span class="preprocessor"></span><span class="preprocessor">#define PASS      0</span>
<a name="l00386"></a><a class="code" href="_framework__and__interfaces_2src_2asf_2avr32_2utils_2compiler_8h.html#abb508ea8227673f419e9fe3a86c30d8e">00386</a> <span class="preprocessor"></span><span class="preprocessor">#define FAIL      1</span>
<a name="l00387"></a><a class="code" href="_framework__and__interfaces_2src_2asf_2avr32_2utils_2compiler_8h.html#ab811d8c6ff3a505312d3276590444289">00387</a> <span class="preprocessor"></span><span class="preprocessor">#define LOW       0</span>
<a name="l00388"></a><a class="code" href="_framework__and__interfaces_2src_2asf_2avr32_2utils_2compiler_8h.html#a5bb885982ff66a2e0a0a45a8ee9c35e2">00388</a> <span class="preprocessor"></span><span class="preprocessor">#define HIGH      1</span>
<a name="l00389"></a>00389 <span class="preprocessor"></span>
<a name="l00390"></a>00390 
<a name="l00391"></a>00391 
<a name="l00392"></a>00392 <span class="preprocessor">#ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.</span>
<a name="l00393"></a>00393 <span class="preprocessor"></span>
<a name="l00395"></a>00395 
<a name="l00396"></a>00396 
<a name="l00401"></a>00401 <span class="preprocessor">#ifndef likely</span>
<a name="l00402"></a>00402 <span class="preprocessor"></span><span class="preprocessor"># define likely(exp)    (exp)</span>
<a name="l00403"></a>00403 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00404"></a>00404 <span class="preprocessor"></span>
<a name="l00409"></a>00409 <span class="preprocessor">#ifndef unlikely</span>
<a name="l00410"></a>00410 <span class="preprocessor"></span><span class="preprocessor"># define unlikely(exp)  (exp)</span>
<a name="l00411"></a>00411 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00412"></a>00412 <span class="preprocessor"></span>
<a name="l00421"></a>00421 <span class="preprocessor">#ifdef __GNUC__</span>
<a name="l00422"></a>00422 <span class="preprocessor"></span><span class="preprocessor"># define is_constant(exp)       __builtin_constant_p(exp)</span>
<a name="l00423"></a>00423 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00424"></a>00424 <span class="preprocessor"></span><span class="preprocessor"># define is_constant(exp)       (0)</span>
<a name="l00425"></a>00425 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00426"></a>00426 <span class="preprocessor"></span>
<a name="l00428"></a>00428 
<a name="l00431"></a>00431 
<a name="l00432"></a>00432 
<a name="l00440"></a>00440 <span class="preprocessor">#define Rd_bits( value, mask)        ((value) &amp; (mask))</span>
<a name="l00441"></a>00441 <span class="preprocessor"></span>
<a name="l00450"></a>00450 <span class="preprocessor">#define Wr_bits(lvalue, mask, bits)  ((lvalue) = ((lvalue) &amp; ~(mask)) |\</span>
<a name="l00451"></a>00451 <span class="preprocessor">                                                 ((bits  ) &amp;  (mask)))</span>
<a name="l00452"></a>00452 <span class="preprocessor"></span>
<a name="l00460"></a>00460 <span class="preprocessor">#define Tst_bits( value, mask)  (Rd_bits(value, mask) != 0)</span>
<a name="l00461"></a>00461 <span class="preprocessor"></span>
<a name="l00469"></a>00469 <span class="preprocessor">#define Clr_bits(lvalue, mask)  ((lvalue) &amp;= ~(mask))</span>
<a name="l00470"></a>00470 <span class="preprocessor"></span>
<a name="l00478"></a>00478 <span class="preprocessor">#define Set_bits(lvalue, mask)  ((lvalue) |=  (mask))</span>
<a name="l00479"></a>00479 <span class="preprocessor"></span>
<a name="l00487"></a>00487 <span class="preprocessor">#define Tgl_bits(lvalue, mask)  ((lvalue) ^=  (mask))</span>
<a name="l00488"></a>00488 <span class="preprocessor"></span>
<a name="l00496"></a>00496 <span class="preprocessor">#define Rd_bitfield( value, mask)           (Rd_bits( value, mask) &gt;&gt; ctz(mask))</span>
<a name="l00497"></a>00497 <span class="preprocessor"></span>
<a name="l00506"></a>00506 <span class="preprocessor">#define Wr_bitfield(lvalue, mask, bitfield) (Wr_bits(lvalue, mask, (U32)(bitfield) &lt;&lt; ctz(mask)))</span>
<a name="l00507"></a>00507 <span class="preprocessor"></span>
<a name="l00509"></a>00509 
<a name="l00510"></a>00510 
<a name="l00520"></a>00520 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l00521"></a>00521 <span class="preprocessor"></span><span class="preprocessor"># define cpu_relax()             __asm__ __volatile__(&quot;sub pc, pc, -4&quot; ::: &quot;memory&quot;, &quot;cc&quot;)</span>
<a name="l00522"></a>00522 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l00523"></a>00523 <span class="preprocessor"></span><span class="preprocessor"># define cpu_relax()             __asm__ __volatile__(&quot;sub pc, pc, -4&quot;)</span>
<a name="l00524"></a>00524 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00525"></a>00525 <span class="preprocessor"></span>
<a name="l00526"></a>00526 
<a name="l00534"></a>00534 <span class="preprocessor">#ifdef _ASSERT_ENABLE_</span>
<a name="l00535"></a>00535 <span class="preprocessor"></span><span class="preprocessor">  #define Assert(expr) \</span>
<a name="l00536"></a>00536 <span class="preprocessor">  {\</span>
<a name="l00537"></a>00537 <span class="preprocessor">    if (!(expr)) while (true);\</span>
<a name="l00538"></a>00538 <span class="preprocessor">  }</span>
<a name="l00539"></a>00539 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00540"></a>00540 <span class="preprocessor"></span><span class="preprocessor">        #define Assert(expr) ((void) 0)</span>
<a name="l00541"></a>00541 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00542"></a>00542 <span class="preprocessor"></span>
<a name="l00543"></a>00543 
<a name="l00556"></a>00556 
<a name="l00557"></a>00557 
<a name="l00564"></a>00564 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l00565"></a>00565 <span class="preprocessor"></span><span class="preprocessor">  #define clz(u)              __builtin_clz(u)</span>
<a name="l00566"></a>00566 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l00567"></a>00567 <span class="preprocessor"></span><span class="preprocessor">  #if (__VER__ == 330) &amp;&amp; (__SUBVERSION__ &lt;= 1)</span>
<a name="l00568"></a>00568 <span class="preprocessor"></span>    <span class="comment">// __count_leading_zeros is broken and returns a value which is offset by</span>
<a name="l00569"></a>00569     <span class="comment">// -32 when called with a constant parameter.</span>
<a name="l00570"></a>00570 <span class="preprocessor">    #define clz(v) (0 == v ? 32 : (31 &amp; __count_leading_zeros(v)))</span>
<a name="l00571"></a>00571 <span class="preprocessor"></span><span class="preprocessor">  #else</span>
<a name="l00572"></a>00572 <span class="preprocessor"></span><span class="preprocessor">    #define clz(v) __count_leading_zeros(v)</span>
<a name="l00573"></a>00573 <span class="preprocessor"></span><span class="preprocessor">  #endif</span>
<a name="l00574"></a>00574 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00575"></a>00575 <span class="preprocessor"></span>
<a name="l00582"></a>00582 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l00583"></a>00583 <span class="preprocessor"></span><span class="preprocessor">  #define ctz(u)              __builtin_ctz(u)</span>
<a name="l00584"></a>00584 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l00585"></a>00585 <span class="preprocessor"></span><span class="preprocessor">  #define ctz(u)              __count_trailing_zeros(u)</span>
<a name="l00586"></a>00586 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00587"></a>00587 <span class="preprocessor"></span>
<a name="l00589"></a>00589 
<a name="l00592"></a>00592 
<a name="l00598"></a>00598 int_fast8_t ilog2_undefined(<span class="keywordtype">void</span>);
<a name="l00599"></a>00599 
<a name="l00607"></a>00607 <span class="keyword">static</span> <span class="keyword">inline</span> int_fast8_t ilog2(uint32_t x)
<a name="l00608"></a>00608 {
<a name="l00609"></a>00609         <span class="keywordflow">if</span> (is_constant(x))
<a name="l00610"></a>00610                 <span class="keywordflow">return</span> ((x) &amp; (1ULL &lt;&lt; 31) ? 31 :
<a name="l00611"></a>00611                         (x) &amp; (1ULL &lt;&lt; 30) ? 30 :
<a name="l00612"></a>00612                         (x) &amp; (1ULL &lt;&lt; 29) ? 29 :
<a name="l00613"></a>00613                         (x) &amp; (1ULL &lt;&lt; 28) ? 28 :
<a name="l00614"></a>00614                         (x) &amp; (1ULL &lt;&lt; 27) ? 27 :
<a name="l00615"></a>00615                         (x) &amp; (1ULL &lt;&lt; 26) ? 26 :
<a name="l00616"></a>00616                         (x) &amp; (1ULL &lt;&lt; 25) ? 25 :
<a name="l00617"></a>00617                         (x) &amp; (1ULL &lt;&lt; 24) ? 24 :
<a name="l00618"></a>00618                         (x) &amp; (1ULL &lt;&lt; 23) ? 23 :
<a name="l00619"></a>00619                         (x) &amp; (1ULL &lt;&lt; 22) ? 22 :
<a name="l00620"></a>00620                         (x) &amp; (1ULL &lt;&lt; 21) ? 21 :
<a name="l00621"></a>00621                         (x) &amp; (1ULL &lt;&lt; 20) ? 20 :
<a name="l00622"></a>00622                         (x) &amp; (1ULL &lt;&lt; 19) ? 19 :
<a name="l00623"></a>00623                         (x) &amp; (1ULL &lt;&lt; 18) ? 18 :
<a name="l00624"></a>00624                         (x) &amp; (1ULL &lt;&lt; 17) ? 17 :
<a name="l00625"></a>00625                         (x) &amp; (1ULL &lt;&lt; 16) ? 16 :
<a name="l00626"></a>00626                         (x) &amp; (1ULL &lt;&lt; 15) ? 15 :
<a name="l00627"></a>00627                         (x) &amp; (1ULL &lt;&lt; 14) ? 14 :
<a name="l00628"></a>00628                         (x) &amp; (1ULL &lt;&lt; 13) ? 13 :
<a name="l00629"></a>00629                         (x) &amp; (1ULL &lt;&lt; 12) ? 12 :
<a name="l00630"></a>00630                         (x) &amp; (1ULL &lt;&lt; 11) ? 11 :
<a name="l00631"></a>00631                         (x) &amp; (1ULL &lt;&lt; 10) ? 10 :
<a name="l00632"></a>00632                         (x) &amp; (1ULL &lt;&lt;  9) ?  9 :
<a name="l00633"></a>00633                         (x) &amp; (1ULL &lt;&lt;  8) ?  8 :
<a name="l00634"></a>00634                         (x) &amp; (1ULL &lt;&lt;  7) ?  7 :
<a name="l00635"></a>00635                         (x) &amp; (1ULL &lt;&lt;  6) ?  6 :
<a name="l00636"></a>00636                         (x) &amp; (1ULL &lt;&lt;  5) ?  5 :
<a name="l00637"></a>00637                         (x) &amp; (1ULL &lt;&lt;  4) ?  4 :
<a name="l00638"></a>00638                         (x) &amp; (1ULL &lt;&lt;  3) ?  3 :
<a name="l00639"></a>00639                         (x) &amp; (1ULL &lt;&lt;  2) ?  2 :
<a name="l00640"></a>00640                         (x) &amp; (1ULL &lt;&lt;  1) ?  1 :
<a name="l00641"></a>00641                         (x) &amp; (1ULL &lt;&lt;  0) ?  0 :
<a name="l00642"></a>00642                         ilog2_undefined());
<a name="l00643"></a>00643 
<a name="l00644"></a>00644         <span class="keywordflow">return</span> 31 - clz(x);
<a name="l00645"></a>00645 }
<a name="l00646"></a>00646 
<a name="l00648"></a>00648 
<a name="l00651"></a>00651 
<a name="l00652"></a>00652 
<a name="l00659"></a>00659 <span class="preprocessor">#define bit_reverse8(u8)    ((U8)(bit_reverse32((U8)(u8)) &gt;&gt; 24))</span>
<a name="l00660"></a>00660 <span class="preprocessor"></span>
<a name="l00667"></a>00667 <span class="preprocessor">#define bit_reverse16(u16)  ((U16)(bit_reverse32((U16)(u16)) &gt;&gt; 16))</span>
<a name="l00668"></a>00668 <span class="preprocessor"></span>
<a name="l00675"></a>00675 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l00676"></a>00676 <span class="preprocessor"></span><span class="preprocessor">  #define bit_reverse32(u32) \</span>
<a name="l00677"></a>00677 <span class="preprocessor">  (\</span>
<a name="l00678"></a>00678 <span class="preprocessor">    {\</span>
<a name="l00679"></a>00679 <span class="preprocessor">      unsigned int __value = (U32)(u32);\</span>
<a name="l00680"></a>00680 <span class="preprocessor">      __asm__ (&quot;brev\t%0&quot; : &quot;+r&quot; (__value) :  : &quot;cc&quot;);\</span>
<a name="l00681"></a>00681 <span class="preprocessor">      (U32)__value;\</span>
<a name="l00682"></a>00682 <span class="preprocessor">    }\</span>
<a name="l00683"></a>00683 <span class="preprocessor">  )</span>
<a name="l00684"></a>00684 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l00685"></a>00685 <span class="preprocessor"></span><span class="preprocessor">  #define bit_reverse32(u32)  ((U32)__bit_reverse((U32)(u32)))</span>
<a name="l00686"></a>00686 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00687"></a>00687 <span class="preprocessor"></span>
<a name="l00694"></a>00694 <span class="preprocessor">#define bit_reverse64(u64)  ((U64)(((U64)bit_reverse32((U64)(u64) &gt;&gt; 32)) |\</span>
<a name="l00695"></a>00695 <span class="preprocessor">                                   ((U64)bit_reverse32((U64)(u64)) &lt;&lt; 32)))</span>
<a name="l00696"></a>00696 <span class="preprocessor"></span>
<a name="l00698"></a>00698 
<a name="l00699"></a>00699 
<a name="l00702"></a>00702 
<a name="l00703"></a>00703 
<a name="l00711"></a>00711 <span class="preprocessor">#define Test_align(val, n     ) (!Tst_bits( val, (n) - 1     )   )</span>
<a name="l00712"></a>00712 <span class="preprocessor"></span>
<a name="l00720"></a>00720 <span class="preprocessor">#define Get_align( val, n     ) (  Rd_bits( val, (n) - 1     )   )</span>
<a name="l00721"></a>00721 <span class="preprocessor"></span>
<a name="l00730"></a>00730 <span class="preprocessor">#define Set_align(lval, n, alg) (  Wr_bits(lval, (n) - 1, alg)   )</span>
<a name="l00731"></a>00731 <span class="preprocessor"></span>
<a name="l00739"></a>00739 <span class="preprocessor">#define Align_up(  val, n     ) (((val) + ((n) - 1)) &amp; ~((n) - 1))</span>
<a name="l00740"></a>00740 <span class="preprocessor"></span>
<a name="l00748"></a>00748 <span class="preprocessor">#define Align_down(val, n     ) ( (val)              &amp; ~((n) - 1))</span>
<a name="l00749"></a>00749 <span class="preprocessor"></span>
<a name="l00751"></a>00751 
<a name="l00752"></a>00752 
<a name="l00764"></a>00764 
<a name="l00765"></a>00765 
<a name="l00774"></a>00774 <span class="preprocessor">#define Abs(a)              (((a) &lt;  0 ) ? -(a) : (a))</span>
<a name="l00775"></a>00775 <span class="preprocessor"></span>
<a name="l00785"></a>00785 <span class="preprocessor">#define Min(a, b)           (((a) &lt; (b)) ?  (a) : (b))</span>
<a name="l00786"></a>00786 <span class="preprocessor"></span>
<a name="l00796"></a>00796 <span class="preprocessor">#define Max(a, b)           (((a) &gt; (b)) ?  (a) : (b))</span>
<a name="l00797"></a>00797 <span class="preprocessor"></span>
<a name="l00806"></a>00806 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l00807"></a>00807 <span class="preprocessor"></span><span class="preprocessor">  #define abs(a) \</span>
<a name="l00808"></a>00808 <span class="preprocessor">  (\</span>
<a name="l00809"></a>00809 <span class="preprocessor">    {\</span>
<a name="l00810"></a>00810 <span class="preprocessor">      int __value = (a);\</span>
<a name="l00811"></a>00811 <span class="preprocessor">      __asm__ (&quot;abs\t%0&quot; : &quot;+r&quot; (__value) :  : &quot;cc&quot;);\</span>
<a name="l00812"></a>00812 <span class="preprocessor">      __value;\</span>
<a name="l00813"></a>00813 <span class="preprocessor">    }\</span>
<a name="l00814"></a>00814 <span class="preprocessor">  )</span>
<a name="l00815"></a>00815 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l00816"></a>00816 <span class="preprocessor"></span><span class="preprocessor">  #define abs(a)      Abs(a)</span>
<a name="l00817"></a>00817 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00818"></a>00818 <span class="preprocessor"></span>
<a name="l00828"></a>00828 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l00829"></a>00829 <span class="preprocessor"></span><span class="preprocessor">  #define min(a, b) \</span>
<a name="l00830"></a>00830 <span class="preprocessor">  (\</span>
<a name="l00831"></a>00831 <span class="preprocessor">    {\</span>
<a name="l00832"></a>00832 <span class="preprocessor">      int __value, __arg_a = (a), __arg_b = (b);\</span>
<a name="l00833"></a>00833 <span class="preprocessor">      __asm__ (&quot;min\t%0, %1, %2&quot; : &quot;=r&quot; (__value) : &quot;r&quot; (__arg_a), &quot;r&quot; (__arg_b));\</span>
<a name="l00834"></a>00834 <span class="preprocessor">      __value;\</span>
<a name="l00835"></a>00835 <span class="preprocessor">    }\</span>
<a name="l00836"></a>00836 <span class="preprocessor">  )</span>
<a name="l00837"></a>00837 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l00838"></a>00838 <span class="preprocessor"></span><span class="preprocessor">  #define min(a, b)   __min(a, b)</span>
<a name="l00839"></a>00839 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00840"></a>00840 <span class="preprocessor"></span>
<a name="l00850"></a>00850 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l00851"></a>00851 <span class="preprocessor"></span><span class="preprocessor">  #define max(a, b) \</span>
<a name="l00852"></a>00852 <span class="preprocessor">  (\</span>
<a name="l00853"></a>00853 <span class="preprocessor">    {\</span>
<a name="l00854"></a>00854 <span class="preprocessor">      int __value, __arg_a = (a), __arg_b = (b);\</span>
<a name="l00855"></a>00855 <span class="preprocessor">      __asm__ (&quot;max\t%0, %1, %2&quot; : &quot;=r&quot; (__value) : &quot;r&quot; (__arg_a), &quot;r&quot; (__arg_b));\</span>
<a name="l00856"></a>00856 <span class="preprocessor">      __value;\</span>
<a name="l00857"></a>00857 <span class="preprocessor">    }\</span>
<a name="l00858"></a>00858 <span class="preprocessor">  )</span>
<a name="l00859"></a>00859 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l00860"></a>00860 <span class="preprocessor"></span><span class="preprocessor">  #define max(a, b)   __max(a, b)</span>
<a name="l00861"></a>00861 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00862"></a>00862 <span class="preprocessor"></span>
<a name="l00864"></a>00864 
<a name="l00865"></a>00865 
<a name="l00877"></a>00877 <span class="preprocessor">#define Long_call(addr)                   ((*(void (*)(void))(addr))())</span>
<a name="l00878"></a>00878 <span class="preprocessor"></span>
<a name="l00883"></a>00883 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l00884"></a>00884 <span class="preprocessor"></span><span class="preprocessor">  #define Reset_CPU() \</span>
<a name="l00885"></a>00885 <span class="preprocessor">  (\</span>
<a name="l00886"></a>00886 <span class="preprocessor">    {\</span>
<a name="l00887"></a>00887 <span class="preprocessor">      __asm__ __volatile__ (\</span>
<a name="l00888"></a>00888 <span class="preprocessor">        &quot;lddpc   r9, 3f\n\t&quot;\</span>
<a name="l00889"></a>00889 <span class="preprocessor">        &quot;mfsr    r8, %[SR]\n\t&quot;\</span>
<a name="l00890"></a>00890 <span class="preprocessor">        &quot;bfextu  r8, r8, %[SR_M_OFFSET], %[SR_M_SIZE]\n\t&quot;\</span>
<a name="l00891"></a>00891 <span class="preprocessor">        &quot;cp.w    r8, 0b001\n\t&quot;\</span>
<a name="l00892"></a>00892 <span class="preprocessor">        &quot;breq    0f\n\t&quot;\</span>
<a name="l00893"></a>00893 <span class="preprocessor">        &quot;sub     r8, pc, $ - 1f\n\t&quot;\</span>
<a name="l00894"></a>00894 <span class="preprocessor">        &quot;pushm   r8-r9\n\t&quot;\</span>
<a name="l00895"></a>00895 <span class="preprocessor">        &quot;rete\n&quot;\</span>
<a name="l00896"></a>00896 <span class="preprocessor">        &quot;0:\n\t&quot;\</span>
<a name="l00897"></a>00897 <span class="preprocessor">        &quot;mtsr    %[SR], r9\n&quot;\</span>
<a name="l00898"></a>00898 <span class="preprocessor">        &quot;1:\n\t&quot;\</span>
<a name="l00899"></a>00899 <span class="preprocessor">        &quot;mov     r0, 0\n\t&quot;\</span>
<a name="l00900"></a>00900 <span class="preprocessor">        &quot;mov     r1, 0\n\t&quot;\</span>
<a name="l00901"></a>00901 <span class="preprocessor">        &quot;mov     r2, 0\n\t&quot;\</span>
<a name="l00902"></a>00902 <span class="preprocessor">        &quot;mov     r3, 0\n\t&quot;\</span>
<a name="l00903"></a>00903 <span class="preprocessor">        &quot;mov     r4, 0\n\t&quot;\</span>
<a name="l00904"></a>00904 <span class="preprocessor">        &quot;mov     r5, 0\n\t&quot;\</span>
<a name="l00905"></a>00905 <span class="preprocessor">        &quot;mov     r6, 0\n\t&quot;\</span>
<a name="l00906"></a>00906 <span class="preprocessor">        &quot;mov     r7, 0\n\t&quot;\</span>
<a name="l00907"></a>00907 <span class="preprocessor">        &quot;mov     r8, 0\n\t&quot;\</span>
<a name="l00908"></a>00908 <span class="preprocessor">        &quot;mov     r9, 0\n\t&quot;\</span>
<a name="l00909"></a>00909 <span class="preprocessor">        &quot;mov     r10, 0\n\t&quot;\</span>
<a name="l00910"></a>00910 <span class="preprocessor">        &quot;mov     r11, 0\n\t&quot;\</span>
<a name="l00911"></a>00911 <span class="preprocessor">        &quot;mov     r12, 0\n\t&quot;\</span>
<a name="l00912"></a>00912 <span class="preprocessor">        &quot;mov     sp, 0\n\t&quot;\</span>
<a name="l00913"></a>00913 <span class="preprocessor">        &quot;stdsp   sp[0], sp\n\t&quot;\</span>
<a name="l00914"></a>00914 <span class="preprocessor">        &quot;ldmts   sp, sp\n\t&quot;\</span>
<a name="l00915"></a>00915 <span class="preprocessor">        &quot;mov     lr, 0\n\t&quot;\</span>
<a name="l00916"></a>00916 <span class="preprocessor">        &quot;lddpc   pc, 2f\n\t&quot;\</span>
<a name="l00917"></a>00917 <span class="preprocessor">        &quot;.balign 4\n&quot;\</span>
<a name="l00918"></a>00918 <span class="preprocessor">        &quot;2:\n\t&quot;\</span>
<a name="l00919"></a>00919 <span class="preprocessor">        &quot;.word   _start\n&quot;\</span>
<a name="l00920"></a>00920 <span class="preprocessor">        &quot;3:\n\t&quot;\</span>
<a name="l00921"></a>00921 <span class="preprocessor">        &quot;.word   %[RESET_SR]&quot;\</span>
<a name="l00922"></a>00922 <span class="preprocessor">        :\</span>
<a name="l00923"></a>00923 <span class="preprocessor">        : [SR] &quot;i&quot; (AVR32_SR),\</span>
<a name="l00924"></a>00924 <span class="preprocessor">          [SR_M_OFFSET] &quot;i&quot; (AVR32_SR_M_OFFSET),\</span>
<a name="l00925"></a>00925 <span class="preprocessor">          [SR_M_SIZE] &quot;i&quot; (AVR32_SR_M_SIZE),\</span>
<a name="l00926"></a>00926 <span class="preprocessor">          [RESET_SR] &quot;i&quot; (AVR32_SR_GM_MASK | AVR32_SR_EM_MASK | (AVR32_SR_M_SUP &lt;&lt; AVR32_SR_M_OFFSET))\</span>
<a name="l00927"></a>00927 <span class="preprocessor">      );\</span>
<a name="l00928"></a>00928 <span class="preprocessor">    }\</span>
<a name="l00929"></a>00929 <span class="preprocessor">  )</span>
<a name="l00930"></a>00930 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l00931"></a>00931 <span class="preprocessor"></span><span class="preprocessor">  #define Reset_CPU() \</span>
<a name="l00932"></a>00932 <span class="preprocessor">  {\</span>
<a name="l00933"></a>00933 <span class="preprocessor">    extern void *volatile __program_start;\</span>
<a name="l00934"></a>00934 <span class="preprocessor">    __asm__ __volatile__ (\</span>
<a name="l00935"></a>00935 <span class="preprocessor">      &quot;mov     r7, LWRD(__program_start)\n\t&quot;\</span>
<a name="l00936"></a>00936 <span class="preprocessor">      &quot;orh     r7, HWRD(__program_start)\n\t&quot;\</span>
<a name="l00937"></a>00937 <span class="preprocessor">      &quot;mov     r9, LWRD(&quot;ASTRINGZ(AVR32_SR_GM_MASK | AVR32_SR_EM_MASK | (AVR32_SR_M_SUP &lt;&lt; AVR32_SR_M_OFFSET))&quot;)\n\t&quot;\</span>
<a name="l00938"></a>00938 <span class="preprocessor">      &quot;orh     r9, HWRD(&quot;ASTRINGZ(AVR32_SR_GM_MASK | AVR32_SR_EM_MASK | (AVR32_SR_M_SUP &lt;&lt; AVR32_SR_M_OFFSET))&quot;)\n\t&quot;\</span>
<a name="l00939"></a>00939 <span class="preprocessor">      &quot;mfsr    r8, &quot;ASTRINGZ(AVR32_SR)&quot;\n\t&quot;\</span>
<a name="l00940"></a>00940 <span class="preprocessor">      &quot;bfextu  r8, r8, &quot;ASTRINGZ(AVR32_SR_M_OFFSET)&quot;, &quot;ASTRINGZ(AVR32_SR_M_SIZE)&quot;\n\t&quot;\</span>
<a name="l00941"></a>00941 <span class="preprocessor">      &quot;cp.w    r8, 001b\n\t&quot;\</span>
<a name="l00942"></a>00942 <span class="preprocessor">      &quot;breq    $ + 10\n\t&quot;\</span>
<a name="l00943"></a>00943 <span class="preprocessor">      &quot;sub     r8, pc, -12\n\t&quot;\</span>
<a name="l00944"></a>00944 <span class="preprocessor">      &quot;pushm   r8-r9\n\t&quot;\</span>
<a name="l00945"></a>00945 <span class="preprocessor">      &quot;rete\n\t&quot;\</span>
<a name="l00946"></a>00946 <span class="preprocessor">      &quot;mtsr    &quot;ASTRINGZ(AVR32_SR)&quot;, r9\n\t&quot;\</span>
<a name="l00947"></a>00947 <span class="preprocessor">      &quot;mov     r0, 0\n\t&quot;\</span>
<a name="l00948"></a>00948 <span class="preprocessor">      &quot;mov     r1, 0\n\t&quot;\</span>
<a name="l00949"></a>00949 <span class="preprocessor">      &quot;mov     r2, 0\n\t&quot;\</span>
<a name="l00950"></a>00950 <span class="preprocessor">      &quot;mov     r3, 0\n\t&quot;\</span>
<a name="l00951"></a>00951 <span class="preprocessor">      &quot;mov     r4, 0\n\t&quot;\</span>
<a name="l00952"></a>00952 <span class="preprocessor">      &quot;mov     r5, 0\n\t&quot;\</span>
<a name="l00953"></a>00953 <span class="preprocessor">      &quot;mov     r6, 0\n\t&quot;\</span>
<a name="l00954"></a>00954 <span class="preprocessor">      &quot;st.w    r0[4], r7\n\t&quot;\</span>
<a name="l00955"></a>00955 <span class="preprocessor">      &quot;mov     r7, 0\n\t&quot;\</span>
<a name="l00956"></a>00956 <span class="preprocessor">      &quot;mov     r8, 0\n\t&quot;\</span>
<a name="l00957"></a>00957 <span class="preprocessor">      &quot;mov     r9, 0\n\t&quot;\</span>
<a name="l00958"></a>00958 <span class="preprocessor">      &quot;mov     r10, 0\n\t&quot;\</span>
<a name="l00959"></a>00959 <span class="preprocessor">      &quot;mov     r11, 0\n\t&quot;\</span>
<a name="l00960"></a>00960 <span class="preprocessor">      &quot;mov     r12, 0\n\t&quot;\</span>
<a name="l00961"></a>00961 <span class="preprocessor">      &quot;mov     sp, 0\n\t&quot;\</span>
<a name="l00962"></a>00962 <span class="preprocessor">      &quot;stdsp   sp[0], sp\n\t&quot;\</span>
<a name="l00963"></a>00963 <span class="preprocessor">      &quot;ldmts   sp, sp\n\t&quot;\</span>
<a name="l00964"></a>00964 <span class="preprocessor">      &quot;mov     lr, 0\n\t&quot;\</span>
<a name="l00965"></a>00965 <span class="preprocessor">      &quot;ld.w    pc, lr[4]&quot;\</span>
<a name="l00966"></a>00966 <span class="preprocessor">    );\</span>
<a name="l00967"></a>00967 <span class="preprocessor">    __program_start;\</span>
<a name="l00968"></a>00968 <span class="preprocessor">  }</span>
<a name="l00969"></a>00969 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00970"></a>00970 <span class="preprocessor"></span>
<a name="l00971"></a>00971 
<a name="l00972"></a>00972 
<a name="l00975"></a>00975 
<a name="l00976"></a>00976 
<a name="l00981"></a>00981 <span class="preprocessor">#define Is_global_exception_enabled()         (!Tst_bits(Get_system_register(AVR32_SR), AVR32_SR_EM_MASK))</span>
<a name="l00982"></a>00982 <span class="preprocessor"></span>
<a name="l00985"></a>00985 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l00986"></a>00986 <span class="preprocessor"></span><span class="preprocessor">  #define Disable_global_exception()          ({__asm__ __volatile__ (&quot;ssrf\t%0&quot; :  : &quot;i&quot; (AVR32_SR_EM_OFFSET));})</span>
<a name="l00987"></a>00987 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l00988"></a>00988 <span class="preprocessor"></span><span class="preprocessor">  #define Disable_global_exception()          (__set_status_flag(AVR32_SR_EM_OFFSET))</span>
<a name="l00989"></a>00989 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00990"></a>00990 <span class="preprocessor"></span>
<a name="l00993"></a>00993 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l00994"></a>00994 <span class="preprocessor"></span><span class="preprocessor">  #define Enable_global_exception()           ({__asm__ __volatile__ (&quot;csrf\t%0&quot; :  : &quot;i&quot; (AVR32_SR_EM_OFFSET));})</span>
<a name="l00995"></a>00995 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l00996"></a>00996 <span class="preprocessor"></span><span class="preprocessor">  #define Enable_global_exception()           (__clear_status_flag(AVR32_SR_EM_OFFSET))</span>
<a name="l00997"></a>00997 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00998"></a>00998 <span class="preprocessor"></span>
<a name="l01000"></a>01000 
<a name="l01001"></a>01001 
<a name="l01004"></a>01004 
<a name="l01005"></a>01005 
<a name="l01012"></a>01012 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l01013"></a>01013 <span class="preprocessor"></span><span class="preprocessor">  #define Get_debug_register(dbgreg)          __builtin_mfdr(dbgreg)</span>
<a name="l01014"></a>01014 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l01015"></a>01015 <span class="preprocessor"></span><span class="preprocessor">  #define Get_debug_register(dbgreg)          __get_debug_register(dbgreg)</span>
<a name="l01016"></a>01016 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l01017"></a>01017 <span class="preprocessor"></span>
<a name="l01023"></a>01023 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l01024"></a>01024 <span class="preprocessor"></span><span class="preprocessor">  #define Set_debug_register(dbgreg, value)   __builtin_mtdr(dbgreg, value)</span>
<a name="l01025"></a>01025 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l01026"></a>01026 <span class="preprocessor"></span><span class="preprocessor">  #define Set_debug_register(dbgreg, value)   __set_debug_register(dbgreg, value)</span>
<a name="l01027"></a>01027 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l01028"></a>01028 <span class="preprocessor"></span>
<a name="l01030"></a>01030 
<a name="l01031"></a>01031 
<a name="l01034"></a>01034 
<a name="l01035"></a>01035 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l01036"></a>01036 <span class="preprocessor"></span><span class="preprocessor">#define __always_inline     __attribute__((__always_inline__))</span>
<a name="l01037"></a>01037 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l01038"></a>01038 <span class="preprocessor"></span><span class="preprocessor">#define __always_inline     _Pragma(&quot;inline=forced&quot;) </span>
<a name="l01039"></a>01039 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l01040"></a>01040 <span class="preprocessor"></span>
<a name="l01041"></a>01041 
<a name="l01045"></a>01045 
<a name="l01046"></a>01046 <span class="preprocessor">#define  MSB(u16)       (((U8  *)&amp;(u16))[0]) //!&lt; Most significant byte of \a u16.</span>
<a name="l01047"></a>01047 <span class="preprocessor"></span><span class="preprocessor">#define  LSB(u16)       (((U8  *)&amp;(u16))[1]) //!&lt; Least significant byte of \a u16.</span>
<a name="l01048"></a>01048 <span class="preprocessor"></span>        
<a name="l01049"></a>01049 <span class="preprocessor">#define  MSH(u32)       (((U16 *)&amp;(u32))[0]) //!&lt; Most significant half-word of \a u32.</span>
<a name="l01050"></a>01050 <span class="preprocessor"></span><span class="preprocessor">#define  LSH(u32)       (((U16 *)&amp;(u32))[1]) //!&lt; Least significant half-word of \a u32.</span>
<a name="l01051"></a>01051 <span class="preprocessor"></span><span class="preprocessor">#define  MSB0W(u32)     (((U8  *)&amp;(u32))[0]) //!&lt; Most significant byte of 1st rank of \a u32.</span>
<a name="l01052"></a>01052 <span class="preprocessor"></span><span class="preprocessor">#define  MSB1W(u32)     (((U8  *)&amp;(u32))[1]) //!&lt; Most significant byte of 2nd rank of \a u32.</span>
<a name="l01053"></a>01053 <span class="preprocessor"></span><span class="preprocessor">#define  MSB2W(u32)     (((U8  *)&amp;(u32))[2]) //!&lt; Most significant byte of 3rd rank of \a u32.</span>
<a name="l01054"></a>01054 <span class="preprocessor"></span><span class="preprocessor">#define  MSB3W(u32)     (((U8  *)&amp;(u32))[3]) //!&lt; Most significant byte of 4th rank of \a u32.</span>
<a name="l01055"></a>01055 <span class="preprocessor"></span><span class="preprocessor">#define  LSB3W(u32)     MSB0W(u32)           //!&lt; Least significant byte of 4th rank of \a u32.</span>
<a name="l01056"></a>01056 <span class="preprocessor"></span><span class="preprocessor">#define  LSB2W(u32)     MSB1W(u32)           //!&lt; Least significant byte of 3rd rank of \a u32.</span>
<a name="l01057"></a>01057 <span class="preprocessor"></span><span class="preprocessor">#define  LSB1W(u32)     MSB2W(u32)           //!&lt; Least significant byte of 2nd rank of \a u32.</span>
<a name="l01058"></a>01058 <span class="preprocessor"></span><span class="preprocessor">#define  LSB0W(u32)     MSB3W(u32)           //!&lt; Least significant byte of 1st rank of \a u32.</span>
<a name="l01059"></a>01059 <span class="preprocessor"></span>        
<a name="l01060"></a>01060 <span class="preprocessor">#define  MSW(u64)       (((U32 *)&amp;(u64))[0]) //!&lt; Most significant word of \a u64.</span>
<a name="l01061"></a>01061 <span class="preprocessor"></span><span class="preprocessor">#define  LSW(u64)       (((U32 *)&amp;(u64))[1]) //!&lt; Least significant word of \a u64.</span>
<a name="l01062"></a>01062 <span class="preprocessor"></span><span class="preprocessor">#define  MSH0(u64)      (((U16 *)&amp;(u64))[0]) //!&lt; Most significant half-word of 1st rank of \a u64.</span>
<a name="l01063"></a>01063 <span class="preprocessor"></span><span class="preprocessor">#define  MSH1(u64)      (((U16 *)&amp;(u64))[1]) //!&lt; Most significant half-word of 2nd rank of \a u64.</span>
<a name="l01064"></a>01064 <span class="preprocessor"></span><span class="preprocessor">#define  MSH2(u64)      (((U16 *)&amp;(u64))[2]) //!&lt; Most significant half-word of 3rd rank of \a u64.</span>
<a name="l01065"></a>01065 <span class="preprocessor"></span><span class="preprocessor">#define  MSH3(u64)      (((U16 *)&amp;(u64))[3]) //!&lt; Most significant half-word of 4th rank of \a u64.</span>
<a name="l01066"></a>01066 <span class="preprocessor"></span><span class="preprocessor">#define  LSH3(u64)      MSH0(u64)            //!&lt; Least significant half-word of 4th rank of \a u64.</span>
<a name="l01067"></a>01067 <span class="preprocessor"></span><span class="preprocessor">#define  LSH2(u64)      MSH1(u64)            //!&lt; Least significant half-word of 3rd rank of \a u64.</span>
<a name="l01068"></a>01068 <span class="preprocessor"></span><span class="preprocessor">#define  LSH1(u64)      MSH2(u64)            //!&lt; Least significant half-word of 2nd rank of \a u64.</span>
<a name="l01069"></a>01069 <span class="preprocessor"></span><span class="preprocessor">#define  LSH0(u64)      MSH3(u64)            //!&lt; Least significant half-word of 1st rank of \a u64.</span>
<a name="l01070"></a>01070 <span class="preprocessor"></span><span class="preprocessor">#define  MSB0D(u64)     (((U8  *)&amp;(u64))[0]) //!&lt; Most significant byte of 1st rank of \a u64.</span>
<a name="l01071"></a>01071 <span class="preprocessor"></span><span class="preprocessor">#define  MSB1D(u64)     (((U8  *)&amp;(u64))[1]) //!&lt; Most significant byte of 2nd rank of \a u64.</span>
<a name="l01072"></a>01072 <span class="preprocessor"></span><span class="preprocessor">#define  MSB2D(u64)     (((U8  *)&amp;(u64))[2]) //!&lt; Most significant byte of 3rd rank of \a u64.</span>
<a name="l01073"></a>01073 <span class="preprocessor"></span><span class="preprocessor">#define  MSB3D(u64)     (((U8  *)&amp;(u64))[3]) //!&lt; Most significant byte of 4th rank of \a u64.</span>
<a name="l01074"></a>01074 <span class="preprocessor"></span><span class="preprocessor">#define  MSB4D(u64)     (((U8  *)&amp;(u64))[4]) //!&lt; Most significant byte of 5th rank of \a u64.</span>
<a name="l01075"></a>01075 <span class="preprocessor"></span><span class="preprocessor">#define  MSB5D(u64)     (((U8  *)&amp;(u64))[5]) //!&lt; Most significant byte of 6th rank of \a u64.</span>
<a name="l01076"></a>01076 <span class="preprocessor"></span><span class="preprocessor">#define  MSB6D(u64)     (((U8  *)&amp;(u64))[6]) //!&lt; Most significant byte of 7th rank of \a u64.</span>
<a name="l01077"></a>01077 <span class="preprocessor"></span><span class="preprocessor">#define  MSB7D(u64)     (((U8  *)&amp;(u64))[7]) //!&lt; Most significant byte of 8th rank of \a u64.</span>
<a name="l01078"></a>01078 <span class="preprocessor"></span><span class="preprocessor">#define  LSB7D(u64)     MSB0D(u64)           //!&lt; Least significant byte of 8th rank of \a u64.</span>
<a name="l01079"></a>01079 <span class="preprocessor"></span><span class="preprocessor">#define  LSB6D(u64)     MSB1D(u64)           //!&lt; Least significant byte of 7th rank of \a u64.</span>
<a name="l01080"></a>01080 <span class="preprocessor"></span><span class="preprocessor">#define  LSB5D(u64)     MSB2D(u64)           //!&lt; Least significant byte of 6th rank of \a u64.</span>
<a name="l01081"></a>01081 <span class="preprocessor"></span><span class="preprocessor">#define  LSB4D(u64)     MSB3D(u64)           //!&lt; Least significant byte of 5th rank of \a u64.</span>
<a name="l01082"></a>01082 <span class="preprocessor"></span><span class="preprocessor">#define  LSB3D(u64)     MSB4D(u64)           //!&lt; Least significant byte of 4th rank of \a u64.</span>
<a name="l01083"></a>01083 <span class="preprocessor"></span><span class="preprocessor">#define  LSB2D(u64)     MSB5D(u64)           //!&lt; Least significant byte of 3rd rank of \a u64.</span>
<a name="l01084"></a>01084 <span class="preprocessor"></span><span class="preprocessor">#define  LSB1D(u64)     MSB6D(u64)           //!&lt; Least significant byte of 2nd rank of \a u64.</span>
<a name="l01085"></a>01085 <span class="preprocessor"></span><span class="preprocessor">#define  LSB0D(u64)     MSB7D(u64)           //!&lt; Least significant byte of 1st rank of \a u64.</span>
<a name="l01086"></a>01086 <span class="preprocessor"></span>
<a name="l01087"></a>01087 <span class="preprocessor">#define  LE16(x)        Swap16(x)        </span>
<a name="l01088"></a>01088 <span class="preprocessor"></span><span class="preprocessor">#define  le16_to_cpu(x) swap16(x)</span>
<a name="l01089"></a>01089 <span class="preprocessor"></span><span class="preprocessor">#define  cpu_to_le16(x) swap16(x)</span>
<a name="l01090"></a>01090 <span class="preprocessor"></span><span class="preprocessor">#define  LE16_TO_CPU(x) Swap16(x)</span>
<a name="l01091"></a>01091 <span class="preprocessor"></span><span class="preprocessor">#define  CPU_TO_LE16(x) Swap16(x)</span>
<a name="l01092"></a>01092 <span class="preprocessor"></span>        
<a name="l01093"></a>01093 <span class="preprocessor">#define  be16_to_cpu(x) (x)</span>
<a name="l01094"></a>01094 <span class="preprocessor"></span><span class="preprocessor">#define  cpu_to_be16(x) (x)</span>
<a name="l01095"></a>01095 <span class="preprocessor"></span><span class="preprocessor">#define  BE16_TO_CPU(x) (x)</span>
<a name="l01096"></a>01096 <span class="preprocessor"></span><span class="preprocessor">#define  CPU_TO_BE16(x) (x)</span>
<a name="l01097"></a>01097 <span class="preprocessor"></span>        
<a name="l01098"></a>01098 <span class="preprocessor">#define  le32_to_cpu(x) swap32(x)</span>
<a name="l01099"></a>01099 <span class="preprocessor"></span><span class="preprocessor">#define  cpu_to_le32(x) swap32(x)</span>
<a name="l01100"></a>01100 <span class="preprocessor"></span><span class="preprocessor">#define  LE32_TO_CPU(x) Swap32(x)</span>
<a name="l01101"></a>01101 <span class="preprocessor"></span><span class="preprocessor">#define  CPU_TO_LE32(x) Swap32(x)</span>
<a name="l01102"></a>01102 <span class="preprocessor"></span>        
<a name="l01103"></a>01103 <span class="preprocessor">#define  be32_to_cpu(x) (x)</span>
<a name="l01104"></a>01104 <span class="preprocessor"></span><span class="preprocessor">#define  cpu_to_be32(x) (x)</span>
<a name="l01105"></a>01105 <span class="preprocessor"></span><span class="preprocessor">#define  BE32_TO_CPU(x) (x)</span>
<a name="l01106"></a>01106 <span class="preprocessor"></span><span class="preprocessor">#define  CPU_TO_BE32(x) (x)</span>
<a name="l01107"></a>01107 <span class="preprocessor"></span>
<a name="l01108"></a>01108 
<a name="l01109"></a>01109 
<a name="l01120"></a>01120 
<a name="l01121"></a>01121 
<a name="l01130"></a>01130 <span class="preprocessor">#define Swap16(u16) ((U16)(((U16)(u16) &gt;&gt; 8) |\</span>
<a name="l01131"></a>01131 <span class="preprocessor">                           ((U16)(u16) &lt;&lt; 8)))</span>
<a name="l01132"></a>01132 <span class="preprocessor"></span>
<a name="l01141"></a>01141 <span class="preprocessor">#define Swap32(u32) ((U32)(((U32)Swap16((U32)(u32) &gt;&gt; 16)) |\</span>
<a name="l01142"></a>01142 <span class="preprocessor">                           ((U32)Swap16((U32)(u32)) &lt;&lt; 16)))</span>
<a name="l01143"></a>01143 <span class="preprocessor"></span>
<a name="l01152"></a>01152 <span class="preprocessor">#define Swap64(u64) ((U64)(((U64)Swap32((U64)(u64) &gt;&gt; 32)) |\</span>
<a name="l01153"></a>01153 <span class="preprocessor">                           ((U64)Swap32((U64)(u64)) &lt;&lt; 32)))</span>
<a name="l01154"></a>01154 <span class="preprocessor"></span>
<a name="l01163"></a>01163 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l01164"></a>01164 <span class="preprocessor"></span><span class="preprocessor">#  if (!defined __OPTIMIZE_SIZE__) || !__OPTIMIZE_SIZE__ </span>
<a name="l01165"></a>01165 <span class="preprocessor"></span><span class="preprocessor">  #define swap16(u16) ((U16)__builtin_bswap_16((U16)(u16)))</span>
<a name="l01166"></a>01166 <span class="preprocessor"></span><span class="preprocessor">#  else</span>
<a name="l01167"></a>01167 <span class="preprocessor"></span>  <span class="comment">// swap_16 must be not used when GCC&#39;s -Os command option is used</span>
<a name="l01168"></a>01168 <span class="preprocessor">  #define swap16(u16) Swap16(u16)</span>
<a name="l01169"></a>01169 <span class="preprocessor"></span><span class="preprocessor">#  endif</span>
<a name="l01170"></a>01170 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l01171"></a>01171 <span class="preprocessor"></span><span class="preprocessor">  #define swap16(u16) ((U16)__swap_bytes_in_halfwords((U16)(u16)))</span>
<a name="l01172"></a>01172 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l01173"></a>01173 <span class="preprocessor"></span>
<a name="l01182"></a>01182 <span class="preprocessor">#if (defined __GNUC__)</span>
<a name="l01183"></a>01183 <span class="preprocessor"></span><span class="preprocessor">  #define swap32(u32) ((U32)__builtin_bswap_32((U32)(u32)))</span>
<a name="l01184"></a>01184 <span class="preprocessor"></span><span class="preprocessor">#elif (defined __ICCAVR32__)</span>
<a name="l01185"></a>01185 <span class="preprocessor"></span><span class="preprocessor">  #define swap32(u32) ((U32)__swap_bytes((U32)(u32)))</span>
<a name="l01186"></a>01186 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l01187"></a>01187 <span class="preprocessor"></span>
<a name="l01196"></a>01196 <span class="preprocessor">#define swap64(u64) ((U64)(((U64)swap32((U64)(u64) &gt;&gt; 32)) |\</span>
<a name="l01197"></a>01197 <span class="preprocessor">                           ((U64)swap32((U64)(u64)) &lt;&lt; 32)))</span>
<a name="l01198"></a>01198 <span class="preprocessor"></span>
<a name="l01200"></a>01200 
<a name="l01201"></a>01201 
<a name="l01204"></a>01204 
<a name="l01205"></a>01205 
<a name="l01206"></a>01206 <span class="preprocessor">#define _GLOBEXT_           extern      //!&lt; extern storage-class specifier.</span>
<a name="l01207"></a>01207 <span class="preprocessor"></span><span class="preprocessor">#define _CONST_TYPE_        const       //!&lt; const type qualifier.</span>
<a name="l01208"></a>01208 <span class="preprocessor"></span><span class="preprocessor">#define _MEM_TYPE_SLOW_                 //!&lt; Slow memory type.</span>
<a name="l01209"></a>01209 <span class="preprocessor"></span><span class="preprocessor">#define _MEM_TYPE_MEDFAST_              //!&lt; Fairly fast memory type.</span>
<a name="l01210"></a>01210 <span class="preprocessor"></span><span class="preprocessor">#define _MEM_TYPE_FAST_                 //!&lt; Fast memory type.</span>
<a name="l01211"></a>01211 <span class="preprocessor"></span>
<a name="l01212"></a>01212 <span class="keyword">typedef</span> U8                  Byte;       
<a name="l01213"></a>01213 
<a name="l01214"></a>01214 <span class="preprocessor">#define memcmp_ram2ram      memcmp      //!&lt; Target-specific memcmp of RAM to RAM.</span>
<a name="l01215"></a>01215 <span class="preprocessor"></span><span class="preprocessor">#define memcmp_code2ram     memcmp      //!&lt; Target-specific memcmp of RAM to NVRAM.</span>
<a name="l01216"></a>01216 <span class="preprocessor"></span><span class="preprocessor">#define memcpy_ram2ram      memcpy      //!&lt; Target-specific memcpy from RAM to RAM.</span>
<a name="l01217"></a>01217 <span class="preprocessor"></span><span class="preprocessor">#define memcpy_code2ram     memcpy      //!&lt; Target-specific memcpy from NVRAM to RAM.</span>
<a name="l01218"></a>01218 <span class="preprocessor"></span>
<a name="l01219"></a>01219 <span class="preprocessor">#define LSB0(u32)           LSB0W(u32)  //!&lt; Least significant byte of 1st rank of \a u32.</span>
<a name="l01220"></a>01220 <span class="preprocessor"></span><span class="preprocessor">#define LSB1(u32)           LSB1W(u32)  //!&lt; Least significant byte of 2nd rank of \a u32.</span>
<a name="l01221"></a>01221 <span class="preprocessor"></span><span class="preprocessor">#define LSB2(u32)           LSB2W(u32)  //!&lt; Least significant byte of 3rd rank of \a u32.</span>
<a name="l01222"></a>01222 <span class="preprocessor"></span><span class="preprocessor">#define LSB3(u32)           LSB3W(u32)  //!&lt; Least significant byte of 4th rank of \a u32.</span>
<a name="l01223"></a>01223 <span class="preprocessor"></span><span class="preprocessor">#define MSB3(u32)           MSB3W(u32)  //!&lt; Most significant byte of 4th rank of \a u32.</span>
<a name="l01224"></a>01224 <span class="preprocessor"></span><span class="preprocessor">#define MSB2(u32)           MSB2W(u32)  //!&lt; Most significant byte of 3rd rank of \a u32.</span>
<a name="l01225"></a>01225 <span class="preprocessor"></span><span class="preprocessor">#define MSB1(u32)           MSB1W(u32)  //!&lt; Most significant byte of 2nd rank of \a u32.</span>
<a name="l01226"></a>01226 <span class="preprocessor"></span><span class="preprocessor">#define MSB0(u32)           MSB0W(u32)  //!&lt; Most significant byte of 1st rank of \a u32.</span>
<a name="l01227"></a>01227 <span class="preprocessor"></span>
<a name="l01229"></a>01229 
<a name="l01239"></a>01239 <span class="preprocessor">#define div_ceil(a, b)  (((a) + (b) - 1) / (b))</span>
<a name="l01240"></a>01240 <span class="preprocessor"></span>
<a name="l01241"></a>01241 <span class="preprocessor">#endif  // __AVR32_ABI_COMPILER__</span>
<a name="l01242"></a>01242 <span class="preprocessor"></span>
<a name="l01243"></a>01243 
<a name="l01244"></a>01244 <span class="preprocessor">#endif  // _COMPILER_AVR32_H_</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Nov 29 2011 17:59:30 for OpenShoe by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
